//
//  XDMgrComplainCell.m
//  XDEducation
//
//  Created by apple on 2017/5/4.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "XDMgrComplainCell.h"

@implementation XDMgrComplainCell
{
    IBOutlet UILabel *_Time;
    IBOutlet UILabel *_Name;
    IBOutlet UILabel *_Content;
    IBOutlet UILabel *_ToName;
    IBOutlet UILabel *_Complete;
    IBOutlet UILabel *_State;
    IBOutlet UIButton *_Operation;
}

- (void)setModel:(HNComplainModel *)Model
{
    _Model = Model;
    
    _Time.text = Model.createTime;
    _Name.text = Model.petName;
    _Content.text = Model.content;
    _ToName.text = Model.handleName;
    _Complete.text = Model.handleResult;
    _State.text = [self ButtonSelect:Model.status]?@"已处理":@"未处理";
    [_Operation setTitle:[self ButtonSelect:Model.status]?@"已处理":@"处理申诉" forState:(UIControlStateNormal)];
    _Operation.selected = [self ButtonSelect:Model.status];
    _Operation.userInteractionEnabled = ![self ButtonSelect:Model.status];
}

- (BOOL)ButtonSelect:(NSString *)status
{
    if ([status isEqualToString:@"HANDLED"])
    {
        return YES;
    }
    else
    {
        return NO;
    }
}



- (IBAction)ClickMgrButton:(id)sender
{
    if (self.ClickMgr)
    {
        self.ClickMgr (self.Model.ID,self.Model.content);
    }
    
}
@end
